## 指定最低版本
cmake_minimum_required(VERSION 3.5.1)

## 库路径
link_directories(${OUTPUT_PATH}/lib)

set(MODBUS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)

## 搜索源文件
include_directories(${MODBUS_PATH}/inc)
include_directories(${MODBUS_PATH}/port/linux)

## 设置共享库文件夹
# set(LIBRARY_OUTPUT_PATH ${LIBPATH})
file(GLOB HDR_MODBUS_PORT ./mbport_serial.h)
set(SRC_MODBUS_PORT ./mbport_serial.c)

## modbus_port.a
set(MODBUS_PORT_LIB modbusport)
add_library("${MODBUS_PORT_LIB}" STATIC "${HDR_MODBUS_PORT}" "${SRC_MODBUS_PORT}")
set_target_properties("${MODBUS_PORT_LIB}" PROPERTIES OUTPUT_NAME "${MODBUS_PORT_LIB}")